import request from '/@/utils/request';

// 查询消费券类型列表
export function listVoucher(query?: Object) {
  return request({
    url: '/module/voucher/list',
    method: 'get',
    params: query
  })
}

// 查询消费券类型详细
export function getVoucher(id?: number) {
  return request({
    url: '/module/voucher/' + id,
    method: 'get'
  })
}

// 新增消费券类型
export function addVoucher(data?: Object) {
  return request({
    url: '/module/voucher',
    method: 'post',
    data: data
  })
}

// 修改消费券类型
export function updateVoucher(data?: Object) {
  return request({
    url: '/module/voucher',
    method: 'put',
    data: data
  })
}

// 删除消费券类型
export function delVoucher(id?: number) {
  return request({
    url: '/module/voucher/' + id,
    method: 'delete'
  })
}

// 导出消费券类型
export function exportVoucher(query?: Object) {
  return request({
    url: '/module/voucher/export',
    method: 'get',
    params: query
  })
}
